package com.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;

/**
 * 【经营项目】 水电费管理
 */

@Entity
@Table(name = "utility_bill")
@Getter @Setter
public class BusinessUtilityBill extends BaseEntity {
    @Column(name = "project_name")
    private String projectName;

    //月份
    @Column(name = "bill_month")
    @Temporal(TemporalType.DATE)
    @JsonFormat(pattern = "yyyy-MM", timezone = "GMT+8")
    private Date billMonth;

    //应收水费
    @Column(name = "water_fee", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal waterFee =  BigDecimal.ZERO;

    //应收电费
    @Column(name = "electricity_fee", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal electricityFee =  BigDecimal.ZERO;

    //应收总费用
    @Column(name = "total_fee", precision = 15, scale = 2,  columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal totalFee =  BigDecimal.ZERO;

    // 实收水费
    @Column(name = "water_fee_payment", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal waterFeePayment =  BigDecimal.ZERO;

    // 实收电费
    @Column(name = "electricity_fee_payment", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal electricityFeePayment =  BigDecimal.ZERO;

    // 实收总费用
    @Column(name = "total_fee_payment", precision = 15, scale = 2, columnDefinition = "DECIMAL(15,2) default 0")
    private BigDecimal totalFeePayment =  BigDecimal.ZERO;

    @Column(name = "status", columnDefinition = "TINYINT default 0")
    private Integer status;

    @Transient
    private List<BusinessUtilityBillRecord> flows;
}
